package api

import (
	"gitee.com/go-kade/go12/vblog/apps/blog"
	"gitee.com/go-kade/go12/vblog/ioc"
)

func init() {
	ioc.ApiHandler().Registry(&BlogApiHeadler{})
}

type BlogApiHeadler struct {
	svc blog.Service //依赖控制器
}

func NewBlogApiHeadler(TokenServiceImpl blog.Service) *BlogApiHeadler {
	return &BlogApiHeadler{
		// svc: TokenServiceImpl,
		svc: ioc.Controller().Get(blog.AppName).(blog.Service),
	}
}

// 定义对象的初始化
func (i *BlogApiHeadler) Init1() error {
	i.svc = ioc.Controller().Get(blog.AppName).(blog.Service)
	return nil
}

// 定义托管到Ioc里面的名称
func (i *BlogApiHeadler) Name() string {
	return blog.AppName
}
